<%@ page language="java" contentType="text/html; charset=UTF-8" import="java.sql.*,java.util.*"
    pageEncoding="UTF-8"%>
<script src="jquery-latest.js"></script>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" >
<title>UseCase System</title>
</head>
<body>

<%
    String caseid = (String)session.getAttribute("usecaseid");
    String casetype = (String)session.getAttribute("usecasetype");
    
    //out.println(session.getAttribute("userid"));
    //out.println(caseid);
   // out.println(casetype); 
    //out.println("success"); 

    Connection conn = null;
    Statement stmt = null;
    
    Class.forName("com.mysql.jdbc.Driver");
    conn = DriverManager.getConnection("jdbc:mysql://localhost/usecasesystem","root", "12345");
    stmt = conn.createStatement();
		
	

	try{
		
		String sql1 = "DELETE FROM usecase WHERE account_number = '" + session.getAttribute("userid") + "' AND Use_case_ID = '" + caseid + "' AND Case_Type = '" + casetype + "'";

		stmt.executeUpdate(sql1); %>
		
	    delete success !!
   <%
   }
   catch(SQLException e) { %>
      Error !!
   <%
   }
   finally {
         try {
         stmt.close();
         conn.close();
     }
     catch(SQLException e) {

     }
 }
    
    
%>
<% response.setHeader("Refresh", "1; URL=query.jsp"); %>
</body>
</html>